
package bookingsystem;

/*
 * 
 * @author idziakp
 */

import java.net.*;
import java.io.*;

public class Server {
    public static void main(String[] args) throws IOException {
        StartStopForm stForm = new StartStopForm();
        
        ServerSocket server = null;
        int port = 7777;

        Socket client = null;
        try{
            while(true){
            ServerThread st;
            try {
                stForm.setVisible(true);
                server = new ServerSocket(port);
                st = new ServerThread(server.accept());
                Thread t = new Thread(st);
                t.start();
            } catch (IOException e) {
                System.err.println("Accept failed.");
                System.exit(1);
            }
            server.close();
            }
        }
        catch (IOException e){
            System.out.println(e);
        }
    }
}

